<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<header>
               <%--navbar-fixed-top 属性可以固定头部--%>
<nav class="navbar navbar-default  navbar-static-top" role="navigation">
    <div class="container-fluid">
        <div class="navbar-header">
            <button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#bs-example-navbar-collapse-3">
                <span class="sr-only">Toggle navigation</span>
                <span class="icon-bar"></span>
                <span class="icon-bar"></span>
                <span class="icon-bar"></span>
            </button>
            <a class="navbar-brand" href="/">An0nymous</a>
        </div>
        <div class="collapse navbar-collapse" id="bs-example-navbar-collapse-3">
            <ul class="nav navbar-nav" id="list-group">
                <li id="home"><a href="/">Home</a></li>
                <li id="messageBoard"><a href="/messageBoard">留言</a></li>
                <li class="dropdown" id="tools">
                <%--<li class="dropdown open">--%>
                    <a href="#" class="dropdown-toggle" data-toggle="dropdown">工具<span class="caret"></span></a>
                    <ul class="dropdown-menu" role="menu">
                        <li><a href="/druid">Druid Monitor</a></li>
                        <li><a href="javascript:void(0)">google search</a></li>
                        <li id="unicode"><a href="/view/tools/Unicode.jsp">开发常用编码解码</a></li>
                        <%--<li><a href="#">Something else here</a></li>--%>
                        <%--<li class="divider"></li>--%>
                        <%--<li><a href="#">Separated link</a></li>--%>
                        <%--<li class="divider"></li>--%>
                        <%--<li><a href="#">One more separated link</a></li>--%>
                    </ul>
                </li>
                <li ><a href="javascript:void(0)">关于</a></li>
            </ul>
            <form class="navbar-form navbar-right" role="search">
                <div class="form-group">
                    <input type="text" class="form-control" placeholder="Search">
                </div>
                <button type="button" class="btn btn-primary">Primary</button>
            </form>
        </div>
    </div>
</nav>
</header>
<div class="spacing-30"></div>

<script type="text/javascript">
    $(function() {
        var strs= new Array();
        var url = (window.location.href).replace("http://", "");
        strs = url.split("/");
        if(strs[1]=="null"||strs[1]==""){
            $("#home").addClass("active");
        }else if(strs[1]=="messageBoard"){
            $("#messageBoard").addClass("active");
        }else if(strs[1]=="view"){
            $("#tools").addClass("active");
            if(strs[3]=="Unicode.jsp"){
                $("#unicode").addClass("active");
            }
        }
//        $("#list-group li").attr("onclick","onActive(this);");
    });
//    function onActive(obj){
//        obj = $(obj);
//        $("#list-group li").removeClass("active");
//        obj.addClass("active");
//    }
</script>